<script setup>
import {ref} from 'vue'

//导航栏索引
const navIndex=ref(1)

</script>
<template>
	<view class="main-container">
		<!--头部-->
		<view class="header">
			<view class="title">
				康 护 助 手
			</view>
			<view class="tip">
				你 的 智 能 健 康 管 家
			</view>
		</view>
		<!--头部导航栏-->
		<view class="header-nav">
			<view class="home" @tap="navIndex=1" :style="{backgroundColor: navIndex==1 ? 'rgb(213,226,242)' : ''}">
				<view class="box">
					<image src="/static/home.png"></image>
					 <view class="text">首页</view>
				</view>
			</view>
			<view class="inquiry"  @tap="navIndex=2" :style="{backgroundColor: navIndex==2 ? 'rgb(213,226,242)' : ''}">
				<view class="box">
					<image src="/static/inquiry.png" ></image>
					 <view class="text">问诊</view>
				</view>
			</view>
			<view class="health"  @tap="navIndex=3" :style="{backgroundColor: navIndex==3 ? 'rgb(213,226,242)' : ''}">
				<view class="box">
					<image src="/static/food.png"></image>
					 <view class="text">食谱</view>
				</view>
			</view>
			<view class="my"  @tap="navIndex=4" :style="{backgroundColor: navIndex==4 ? 'rgb(213,226,242)' : ''}">
				<view class="box">
					<image src="/static/my.png"></image>
					 <view class="text">我的</view>
				</view>
			</view>
		</view>
		
		<!--主要内容-->
		<home  v-if="navIndex==1"></home>
		<diagnose v-else-if="navIndex==2"></diagnose>
		<food v-else-if="navIndex==3"></food>
		<my v-else></my>
	
	</view>
</template>






<style   lang="scss"  scoped>
.main-container{
	.header{
		width: 100%;
		height: 200rpx;
		text-align: center;
		background-color: rgb(105, 145, 196);
		.title{
			padding-top: 50rpx;
			font-size: 40rpx;
			font-weight: 700;
			color: white;
		}
		.tip{
			font-size: 25rpx;
			color: white;
			margin-top: 20rpx;
		}
	}
	.header-nav{
		display: flex;
		justify-content: space-between;
		margin: 50rpx 50rpx;
		padding-bottom: 20rpx;
		border-bottom: 1rpx solid #eee;
		.text{
			font-size: 22rpx;
		}
		image{
			width: 50rpx;
			height: 50rpx;
		}
		.box{
			width: 120rpx;
			height: 120rpx;
			text-align: center;
			border-radius: 10rpx;
			image{
				margin-top: 10rpx;
			}
		}
		
	}
}
	
	
</style>